\hypertarget{servo__dec_8h}{}\section{servo\+\_\+dec.\+h File Reference}
\label{servo__dec_8h}\index{servo\+\_\+dec.\+h@{servo\+\_\+dec.\+h}}
{\ttfamily \#include $<$stdint.\+h$>$}\\*
{\ttfamily \#include $<$conf\+\_\+general.\+h$>$}\\*
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{servo__dec_8h_a53c55db3c66ec291596ed1f7e6db4d06}{servodec\+\_\+init} (void($\ast$d\+\_\+func)(void))
\item 
void \hyperlink{servo__dec_8h_ae5bacf20ea61fd28be64d44fc2418ac2}{servodec\+\_\+set\+\_\+pulse\+\_\+options} (float start, float end, bool median\+\_\+filter)
\item 
float \hyperlink{servo__dec_8h_ad860a93d8821ab85814bbe3cd0ce6793}{servodec\+\_\+get\+\_\+servo} (int servo\+\_\+num)
\item 
uint32\+\_\+t \hyperlink{servo__dec_8h_afbd7657022854c870403b8de1977028b}{servodec\+\_\+get\+\_\+time\+\_\+since\+\_\+update} (void)
\item 
float \hyperlink{servo__dec_8h_a3187e0123607bd9151a6d446629a7aa7}{servodec\+\_\+get\+\_\+last\+\_\+pulse\+\_\+len} (int servo\+\_\+num)
\end{DoxyCompactItemize}


\subsection{Function Documentation}
\hypertarget{servo__dec_8h_a3187e0123607bd9151a6d446629a7aa7}{}\index{servo\+\_\+dec.\+h@{servo\+\_\+dec.\+h}!servodec\+\_\+get\+\_\+last\+\_\+pulse\+\_\+len@{servodec\+\_\+get\+\_\+last\+\_\+pulse\+\_\+len}}
\index{servodec\+\_\+get\+\_\+last\+\_\+pulse\+\_\+len@{servodec\+\_\+get\+\_\+last\+\_\+pulse\+\_\+len}!servo\+\_\+dec.\+h@{servo\+\_\+dec.\+h}}
\subsubsection[{servodec\+\_\+get\+\_\+last\+\_\+pulse\+\_\+len(int servo\+\_\+num)}]{\setlength{\rightskip}{0pt plus 5cm}float servodec\+\_\+get\+\_\+last\+\_\+pulse\+\_\+len (
\begin{DoxyParamCaption}
\item[{int}]{servo\+\_\+num}
\end{DoxyParamCaption}
)}\label{servo__dec_8h_a3187e0123607bd9151a6d446629a7aa7}
Get the length of the last received pulse.


\begin{DoxyParams}{Parameters}
{\em servo\+\_\+num} & The servo index. If it is out of range, 0.\+0 will be returned.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The length of the last received pulse. 
\end{DoxyReturn}
\hypertarget{servo__dec_8h_ad860a93d8821ab85814bbe3cd0ce6793}{}\index{servo\+\_\+dec.\+h@{servo\+\_\+dec.\+h}!servodec\+\_\+get\+\_\+servo@{servodec\+\_\+get\+\_\+servo}}
\index{servodec\+\_\+get\+\_\+servo@{servodec\+\_\+get\+\_\+servo}!servo\+\_\+dec.\+h@{servo\+\_\+dec.\+h}}
\subsubsection[{servodec\+\_\+get\+\_\+servo(int servo\+\_\+num)}]{\setlength{\rightskip}{0pt plus 5cm}float servodec\+\_\+get\+\_\+servo (
\begin{DoxyParamCaption}
\item[{int}]{servo\+\_\+num}
\end{DoxyParamCaption}
)}\label{servo__dec_8h_ad860a93d8821ab85814bbe3cd0ce6793}
Get a decoded servo value.


\begin{DoxyParams}{Parameters}
{\em servo\+\_\+num} & The servo index. If it is out of range, 0.\+0 will be returned.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The servo value in the range \mbox{[}-\/1.\+0 1.\+0\mbox{]}. 
\end{DoxyReturn}
\hypertarget{servo__dec_8h_afbd7657022854c870403b8de1977028b}{}\index{servo\+\_\+dec.\+h@{servo\+\_\+dec.\+h}!servodec\+\_\+get\+\_\+time\+\_\+since\+\_\+update@{servodec\+\_\+get\+\_\+time\+\_\+since\+\_\+update}}
\index{servodec\+\_\+get\+\_\+time\+\_\+since\+\_\+update@{servodec\+\_\+get\+\_\+time\+\_\+since\+\_\+update}!servo\+\_\+dec.\+h@{servo\+\_\+dec.\+h}}
\subsubsection[{servodec\+\_\+get\+\_\+time\+\_\+since\+\_\+update(void)}]{\setlength{\rightskip}{0pt plus 5cm}uint32\+\_\+t servodec\+\_\+get\+\_\+time\+\_\+since\+\_\+update (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{servo__dec_8h_afbd7657022854c870403b8de1977028b}
Get the amount of milliseconds that has passed since the last time servo positions were received.

\begin{DoxyReturn}{Returns}
The amount of milliseconds that have passed since an update. 
\end{DoxyReturn}
\hypertarget{servo__dec_8h_a53c55db3c66ec291596ed1f7e6db4d06}{}\index{servo\+\_\+dec.\+h@{servo\+\_\+dec.\+h}!servodec\+\_\+init@{servodec\+\_\+init}}
\index{servodec\+\_\+init@{servodec\+\_\+init}!servo\+\_\+dec.\+h@{servo\+\_\+dec.\+h}}
\subsubsection[{servodec\+\_\+init(void($\ast$d\+\_\+func)(void))}]{\setlength{\rightskip}{0pt plus 5cm}void servodec\+\_\+init (
\begin{DoxyParamCaption}
\item[{void($\ast$)(void)}]{d\+\_\+func}
\end{DoxyParamCaption}
)}\label{servo__dec_8h_a53c55db3c66ec291596ed1f7e6db4d06}
Initialize the serve decoding driver.


\begin{DoxyParams}{Parameters}
{\em d\+\_\+func} & A function that should be called every time the servo signals have been decoded. Can be N\+U\+L\+L. \\
\hline
\end{DoxyParams}
\hypertarget{servo__dec_8h_ae5bacf20ea61fd28be64d44fc2418ac2}{}\index{servo\+\_\+dec.\+h@{servo\+\_\+dec.\+h}!servodec\+\_\+set\+\_\+pulse\+\_\+options@{servodec\+\_\+set\+\_\+pulse\+\_\+options}}
\index{servodec\+\_\+set\+\_\+pulse\+\_\+options@{servodec\+\_\+set\+\_\+pulse\+\_\+options}!servo\+\_\+dec.\+h@{servo\+\_\+dec.\+h}}
\subsubsection[{servodec\+\_\+set\+\_\+pulse\+\_\+options(float start, float end, bool median\+\_\+filter)}]{\setlength{\rightskip}{0pt plus 5cm}void servodec\+\_\+set\+\_\+pulse\+\_\+options (
\begin{DoxyParamCaption}
\item[{float}]{start, }
\item[{float}]{end, }
\item[{bool}]{median\+\_\+filter}
\end{DoxyParamCaption}
)}\label{servo__dec_8h_ae5bacf20ea61fd28be64d44fc2418ac2}
Change the limits of how the servo pulses should be decoded.


\begin{DoxyParams}{Parameters}
{\em start} & The amount of milliseconds the pulse starts at (default is 1.\+0)\\
\hline
{\em end} & he amount of milliseconds the pulse ends at (default is 2.\+0) \\
\hline
\end{DoxyParams}
